package com.example.leetdemo.process;

import java.util.*;

public class Solution828 {

    public int uniqueLetterString(String s) {
        Map<String, Integer> a = new HashMap<>();
        for (int i = 0; i < s.length(); i++) {
            String t = s.substring(i, i + 1);
            Integer v = a.get(t);
            if (v != null) {
                v++;
            } else {
                v = 1;
            }
            a.put(t, v);
        }

        int size = 0;
        for (int i = 0; i < s.length(); i++) {
            Integer length = a.get(s.substring(i, i + 1));

        }

        return size;
    }

    public static void main(String[] args) {
        Solution828 solution828 = new Solution828();
        System.err.println(solution828.uniqueLetterString("ABABA"));
        String s1 = "LEETCODE";
        int size = 0;
        Map<String, Integer> a = new HashMap<>();
        for (int i = 0; i < s1.length(); i++) {
            String t = s1.substring(i, i + 1);
            Integer v = a.get(t);
            if (v != null) {
                v++;
            } else {
                v = 1;
            }
            a.put(t, v);
        }
        for (Integer integer : a.values()) {
            size += integer > 1 ? 0 : 1;
        }
        System.err.println(size);
    }
}
